package com.myspring.service.impl;

import com.myspring.service.UserService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * ClassName: UserServiceImpl
 * Package: com.myspring.service.impl
 * Description:
 *
 * @Author 刘英杰
 * @Create 2024/12/7 21:47
 * @Version 1.0
 */

//@Component("userService") //<bean id="userService" class="com.myspring.service.impl.UserServiceImpl"/>
//@Component
@Service
public class UserServiceImpl implements UserService {
    @Value("1")//将1注入给num
    private int num;

    @Value("abc")//将abc注入给str
    private String str;

    @Override
    public String toString() {
        return "UserServiceImpl{" +
                "num=" + num +
                ", str='" + str + '\'' +
                '}';
    }

}
